package com.example.deal;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.EnableTurbine;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients //开启FeignClient注解
@EnableCircuitBreaker //开启Hystrix熔断机制
@EnableHystrixDashboard
@EnableTurbine //开启Hystrix Turbine聚合Dashboard
public class MicroserviceDealBrokerHystrixDashBoardTurbineApplication {

	public static void main(String[] args) {
		SpringApplication.run(MicroserviceDealBrokerHystrixDashBoardTurbineApplication.class,
				args);
	}
	
	/**
	 * 1被监控的所有服务节点都要开启Hystrix.stream监控，不然Turbine会报错
	 * 
	 * 2访问Turnbine.stream时需注意
	 * http://localhost:8084/turbine.stream 
	 * unable to connect to command metric stream:
	 * 1）stream地址输入错误，一定要输入：ip:port/turbine.stream，可能会误写成：ip:port/turbine.stream，这样一来，反复检查都不容易检查出问题，因为本身后者在使用hystrix时是没错的，但用turbine时就不对了；
	 * 2）缺少pom依赖或注解
	 */
}
